package org.infodavid.common;

import java.io.Serializable;

/**
 * The Class IFactory.
 * @param <T>
 */
public interface IObjectFactory<T extends Serializable> {

	/**
	 * Creates the.
	 * @param <E> the super type
	 * @param clz the interface
	 * @return the instance
	 * @throws InstantiationException the instantiation exception
	 */
	<E extends T> E create(Class<E> clz) throws InstantiationException;

	/**
	 * Gets the builder.
	 * @param <E> the super type
	 * @param clz the interface
	 * @return the builder
	 */
	<E extends T> IBuilder<E> getBuilder(Class<E> clz);

	/**
	 * Gets the builder.
	 * @param <E> the super type
	 * @param clz the interface
	 * @return the builder
	 */
	<E extends T> Class<? extends T> getEntityClass(E entity);
}
